package com.ruoyi.common.core.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.List;

/**
 * 组织结构信息对象 sys_dept
 *
 * @author yfkj
 * @date 2021-10-12
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SysDept extends BaseEntity
{
    private static final long serialVersionUID = 1L;
    /** 组织结构信息主键 */
    @TableField(exist = true)
    @ApiModelProperty(value =  "${comment}")
    @TableId(type= IdType.AUTO)
    private Long deptId;
    /** 父部门id */
    @Excel(name = "父部门id")
    @TableField(exist = true)
    @ApiModelProperty(value =  "父部门id")
    private Long parentId;
    /** 祖级列表 */
    @Excel(name = "祖级列表")
    @TableField(exist = true)
    @ApiModelProperty(value =  "祖级列表")
    private String ancestors;
    /** 部门名称 */
    @Excel(name = "部门名称")
    @TableField(exist = true)
    @ApiModelProperty(value =  "部门名称")
    private String deptShortName;
    /** 部门名称 */
    @Excel(name = "部门名称")
    @TableField(exist = true)
    @ApiModelProperty(value =  "部门名称")
    private String deptFullName;
    /** 组织部门类型数组字符串（0，系统管理部门，1售后管理部门，2资产管理部门，3物联网部门，4巡检部门，5代理商) */
    @Excel(name = "组织部门类型")
    @TableField(exist = true)
    @ApiModelProperty(value =  "组织部门类型数组字符串（0，系统管理部门，1售后管理部门，2资产管理部门，3物联网部门，4巡检部门，5代理商)")
    private String deptType;
    /** 显示顺序 */
    @Excel(name = "显示顺序")
    @TableField(exist = true)
    @ApiModelProperty(value =  "显示顺序")
    private Integer orderNumber;
    /** 负责人 */
    @Excel(name = "负责人")
    @TableField(exist = true)
    @ApiModelProperty(value =  "负责人")
    private String leader;
    /** 联系电话 */
    @Excel(name = "联系电话")
    @TableField(exist = true)
    @ApiModelProperty(value =  "联系电话")
    private String phone;
    /** 邮箱 */
    @Excel(name = "邮箱")
    @TableField(exist = true)
    @ApiModelProperty(value =  "邮箱")
    private String email;
    /** 自定义logo(限制为圆形) */
    @Excel(name = "自定义logo(限制为圆形)")
    @TableField(exist = true)
    @ApiModelProperty(value =  "自定义logo(限制为圆形)")
    private String logo;
    /** 区域id */
    @Excel(name = "区域id")
    @TableField(exist = true)
    @ApiModelProperty(value =  "区域id")
    private Long geographicalId;
    /** 地址 */
    @Excel(name = "地址")
    @TableField(exist = true)
    @ApiModelProperty(value =  "地址")
    private String address;
    /** 部门状态(0停用 1正常) */
    @Excel(name = "部门状态(0停用 1正常)")
    @TableField(exist = true)
    @ApiModelProperty(value =  "部门状态(0停用 1正常)")
    private Integer isFrozen;
    /** 删除标志(1代表存在 0代表删除) */
    @Excel(name = "删除标志(1代表存在 0代表删除)")
    @TableField(exist = true)
    @ApiModelProperty(value =  "删除标志(1代表存在 0代表删除)")
    private Integer isDelete;
    /** 是否为公司(0是公司，1是部门) */
    @Excel(name = "是否为公司(0是公司，1是部门)")
    @TableField(exist = true)
    @ApiModelProperty(value =  "是否为公司(0是公司，1是部门)")
    private Integer isCompany;
    @Excel(name = "企业微信里的部门的id")
    @TableField(exist = true)
    @ApiModelProperty(value =  "企业微信里的部门的id")
    private Long wxDeptId;
    @Excel(name = "集成企业微信时存的企业id")
    @TableField(exist = true)
    @ApiModelProperty(value =  "集成企业微信时存的企业id")
    private String corpId;
    @Excel(name = "钉钉里的部门的id")
    @TableField(exist = true)
    @ApiModelProperty(value =  "钉钉里的部门的id")
    private Long dingDeptId;
    @Excel(name = "集成钉钉时传的AppKey")
    @TableField(exist = true)
    @ApiModelProperty(value =  "集成钉钉时传的AppKey")
    private String appKey;
    @Excel(name = "学校类型（0幼儿园 1小学 2初中 3高中 4大学）")
    @TableField(exist = true)
    @ApiModelProperty(value =  "学校类型（0幼儿园 1小学 2初中 3高中 4大学）")
    private Integer schoolType;

    @TableField(exist = false)
    @ApiModelProperty(value =  "子列表")
    private List<SysDept> children;

    @TableField(exist = false)
    @ApiModelProperty(value =  "备注")
    private String remark;

    @TableField(exist = false)
    @ApiModelProperty(value =  "用于实现小程序的部门树结构中value的唯一性")
    private String flag;

    public static final String DEPT_ID="dept_id";
    public static final String WX_DEPT_ID="wx_dept_id";
    public static final String CORP_ID="corp_id";
    public static final String DING_DEPT_ID="ding_dept_id";
    public static final String APP_KEY="app_key";
    public static final String PARENT_ID="parent_id";
    public static final String ANCESTORS="ancestors";
    public static final String DEPT_SHORT_NAME="dept_short_name";
    public static final String DEPT_FULL_NAME="dept_full_name";
    public static final String DEPT_TYPE="dept_type";
    public static final String ORDER_NUMBER="order_number";
    public static final String LEADER="leader";
    public static final String PHONE="phone";
    public static final String EMAIL="email";
    public static final String LOGO="logo";
    public static final String GEOGRAPHICAL_ID="geographical_id";
    public static final String ADDRESS="address";
    public static final String IS_FROZEN="is_frozen";
    public static final String IS_DELETE="is_delete";
    public static final String IS_COMPANY="is_company";
    public static final String CREATE_BY="create_by";
    public static final String CREATE_TIME="create_time";
    public static final String UPDATE_BY="update_by";
    public static final String UPDATE_TIME="update_time";
    public static final String SCHOOL_TYPE="school_type";

    public SysDept(Long deptId, String deptShortName) {
        this.deptId = deptId;
        this.deptShortName = deptShortName;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("deptId", getDeptId())
                .append("parentId", getParentId())
                .append("ancestors", getAncestors())
                .append("deptShortName", getDeptShortName())
                .append("deptFullName", getDeptFullName())
                .append("deptType", getDeptType())
                .append("orderNumber", getOrderNumber())
                .append("leader", getLeader())
                .append("phone", getPhone())
                .append("email", getEmail())
                .append("logo", getLogo())
                .append("geographicalId", getGeographicalId())
                .append("address", getAddress())
                .append("isFrozen", getIsFrozen())
                .append("isDelete", getIsDelete())
                .append("isCompany", getIsCompany())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
